"""
演示多态和抽象类
"""
from abc import ABC,abstractmethod
class Animal:
    def speak(self):
        pass

class Dog(Animal):
    def speak(self):
        print("汪汪汪")

class Cat(Animal):
    def speak(self):
        print("喵喵喵")

def make_noise(animal: Animal):
    animal.speak()

cat = Cat()
dog = Dog()
make_noise(cat)
make_noise(dog)

class AC(ABC):
    @abstractmethod
    def make_hot(self):
        pass
    def maek_cool(self):
        pass

    def sway_l_r(self):
        pass

class Midea_AC(AC):
    def make_hot(self):
        print("美的制热")
    def maek_cool(self):
        print("美的制冷")
    def sway_l_r(self):
        print("美的左右摆头")

class GREE_AC(AC):
    def make_hot(self):
        print("格力制热")
    def maek_cool(self):
        print("格力制冷")

    def sway_l_r(self):
        pass
        # print("格力左右摆头")
def make_hot(ac:AC):
    ac.make_hot()

midea = Midea_AC()
gree = GREE_AC()
make_hot(midea)
make_hot(gree)